package edu.hz.pro1_50;

import java.math.BigInteger;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int size = scanner.nextInt();
        for (int a = 0; a < size; a++) {
            String first = scanner.next();
            String next = scanner.next();
            System.out.println("Case " + (a + 1) + ":");
            System.out.println(first + " + " + next + " = " + plusStrs(first, next));
            if (a != size -1) {
                System.out.println("------------");
            }
        }

    }

    private static String plusStrs(String first, String next) {
        int size = first.length() > next.length() ? first.length() : next.length();
        int pre = 0;
        String ret = "";
        for (int index = 1; index <= size; index++) {
            int sum = getValue(first, first.length() - index) + getValue(next, next.length() - index);
            ret = (sum % 10 + pre) + ret;
            pre = sum / 10;
        }
        return pre == 0 ? ret : pre + ret;
    }

    private static int getValue(String str, int index) {
        try {
            return Character.getNumericValue(str.charAt(index));
        } catch (Exception e) {
            return 0;
        }
    }

    private static void keys(){
        Scanner s = new Scanner(System.in);
        int T = s.nextInt();
        for (int i = 0; i < T; i++) {
            BigInteger a = s.nextBigInteger();
            BigInteger b = s.nextBigInteger();
            BigInteger c = a.add(b);
            System.out.println("Case " + (i + 1) + ":");
            System.out.println(a.toString() + " + " + b.toString() + " = " + c.toString());
            if (i != T - 1)
                System.out.println();
        }
    }
}
